#pragma once
#ifndef __VIEW_POINT_HPP__
#define __VIEW_POINT_HPP__

#include "geometry/vec.hpp"

namespace PhotonMapping
{
	using namespace NRenderer;
	using namespace std;

	class ViewPoint
	{
	public:
		Vec3 pos;
		Vec3 normal;
		Vec3 color;
		float strength;
		int x, y;
	public:
		ViewPoint() {};
		ViewPoint(Vec3 pos, Vec3 n, Vec3 color, float stgh, int x, int y)
			:pos(pos), normal(n), color(color), strength(stgh), x(x), y(y) 
		{};
		ViewPoint(const ViewPoint& p) {
			this->pos = p.pos;
			this->normal = p.normal;
			this->color = p.color;
			this->strength = p.strength;
			this->x = p.x;
			this->y = p.y;
		}
		~ViewPoint() {};
		friend class PhotonMappingRenderer;

		template <int dim>
		class comparer {
		public:
			bool operator()(const ViewPoint& a, const ViewPoint& b) {
				switch (dim) {
				case 0: return a.pos.x < b.pos.x;
				case 1: return a.pos.y < b.pos.y;
				case 2: return a.pos.z < b.pos.z;
				}
			}
		};
		void setColor(Vec3 c) {
			this->color = c;
		}
		/*static bool cmp(const ViewPoint& a, const ViewPoint& b) {
			switch (dim) {
			case 0: return a.pos.x < b.pos.x;
			case 1: return a.pos.y < b.pos.y;
			case 2: return a.pos.z < b.pos.z;
			}
		}*/
	};
}

#endif